package com.lagou.utils;

import com.alibaba.fastjson.JSON;
import java.io.IOException;


    public class JSONDerializer implements Derializer {

        public <T> T derializer(Class<T> clazz, byte[] bytes) throws IOException {
            if (clazz == null || bytes == null) {
                throw new IllegalArgumentException("argument clazz or bytes can't be null");
            }

            return JSON.parseObject(bytes, clazz);
        }
    }

